package com.tfswue.yhj.listener;

import com.tfswue.yhj.event.UserRegisteredEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Component
public class UserEventListener {
    private static final Logger logger = LoggerFactory.getLogger(UserEventListener.class);

    @EventListener
    public void handleUserRegisteredEvent(UserRegisteredEvent event) {
        logger.info("记录用户注册日志：{} | {}",
                event.getUsername(), event.getEmail());
    }
}
